home *** CD-ROM | disk | FTP | other *** search
Text File | 1986-11-07 | 43.8 KB | 1,321 lines |
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- ECSTAT(tm)
- An instructional econometrics package
- Version 1.1
-
-
-
-
-
- Manual and Program by Robert S. Dohner
- Fletcher School
- Tufts University
- Medford, MA, 02155
-
-
-
-
-
- (Copyright (C) 1984. All rights reserved.)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- NOTICE
- Disclaimer:
- This program is distributed AS IS, and is not guaranteed to be free of
- errors or defects, nor is it guaranteed to do the specific task of the
- user. In no event will the author of this program be liable to you for
- any damages, including any lost profits, lost savings, or other
- incidental or consequential damages arising out of the use of or
- inability to use this program, even if the author of this program has
- been advised of the possibility of such damages, or for any claim by
- any other party.
-
- User Supported Software:
- This program is distributed as User Supported Software. If you find
- this program to be of value, you are encouraged to make a contribution
- of $25 to the author at the address below. An invoice is provided on
- the next page for your convenience. Whether you contribute or not, you
- are encouraged to copy and distribute this program, subject to the
- restrictions below:
-
- A limited license is granted to all users of this program to make
- copies of this program, and of this manual and distribute them to other
- users subject to the following conditions:
-
- 1. Neither this program nor this manual is to be distributed
- to others in modified form.
-
- 2. No more than $10.00 may be charged to cover copying costs, costs
- of media, and costs of distribution.
-
- 3. The notice displayed at the beginning of the program is not to
- altered, bypassed, or removed.
-
- Finally, although this program has been tested extensively, there may
- still be a few remaining errors. The author would appreciate hearing
- about them IN WRITING ONLY. Please report documented errors to:
-
- Robert S. Dohner
- Fletcher School
- Tufts University
- Medford, MA 02155
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -------
- INVOICE
- -------
-
- Purchased from:
- Robert S. Dohner
- Fletcher School
- Tufts University
- Medford, MA 02155
-
- DATE: / / INVOICE # 00127
- -----------------------------------------------------------------
- QTY PRICE
-
- ECSTAT Econometrics Program 1 $25
-
-
- Sales Tax 0
- ------------------
- PLEASE PAY THIS AMOUNT $25 TOTAL
- -----------------------------------------------------------------
-
- Make check payable to: Robert S. Dohner
-
-
- You may retain this invoice for your records
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- PAGE 3
- ECSTAT(tm) Econometrics Program
-
-
- ECSTAT(tm)
- Manual
- (Manual and Program by Robert S. Dohner, copyright (C) 1984)
-
-
- Introduction
-
- This is a simple econometrics program, designed for instructional
- use. It allows the user to:
-
- 1. Enter, edit, and display data
-
- 2. Save data files on disks, and retrieve them from disks.
-
- 3. Create new variables as functions of existing variables,
- including logarithms, exponentials, square roots, and
- trigonometric functions.
-
- 4. Perform multiple linear regression, and linear regression
- corrected for first order autocorrelation. It also allows the
- user to forecast regression equations out of sample.
-
- 5. Create time plots and scatter plots of data
-
- 6. Use sub-ranges of the data for graphing and regression, and
- easily incorporate lags and leads in variables.
-
- The program relies on menus and prompts the user for information at
- most points. Thus the program is relatively easy to learn. At present,
- the program has very few frills. This version is written for the IBM
- Personal computer using advanced basic. A version also exists for the
- Zenith Z-100 personal computer.
-
-
- Some Preliminaries
-
- 1. Format a new disk and transfer the operating system to it, using
- the FORMAT /S command under DOS. Next copy the file BASICA.COM
- (or BASIC.COM if you have the monochrome monitor and do not intend
- to do graphics) onto the formatted disk. Finally copy the files
- ECSTAT.BAT and ECSTAT.BAS onto the disk, as well as the file
- SAMPLE.DAT. To start the program under DOS type in (at the A>
- prompt) ECSTAT .
-
- 2. DO NOT write-protect the disk, as the program needs to write on
- the disk during its operation.
-
- 3. USE CAPITAL LETTERS... The program expects that the user will
- be using capital letters, so make sure that the Caps Lock key on
- the computer is pressed down.
-
-
-
-
-
-
-
-
-
-
-
-
- PAGE 4
- ECSTAT(tm) Econometrics Program
-
-
- 4. The operation of the program revolves around a menu of some 16
- different operations that the user may perform. If you are in the
- midst of some operation and decide that you have made a mistake and
- want to start over, then responding to a question by hitting the
- Enter key (Return key) alone will get you back to the main menu.
-
-
- Starting Out - Selecting the Data Range and Entering Data
-
- The first thing that the program will ask you is:
-
- DO YOU WISH TO LOAD DATA FROM A DISK FILE (Y/N)?>
-
- If you are just starting out, or if you are starting a new problem, the
- answer to this question will be N (for no.) You will immediately
- be asked:
-
- NUMBER OF OBSERVATIONS>
-
- The basic unit of data in this program is the variable, which is given
- a name (e.g. GNP), and consists of a column of numbers that are the
- observations for that variable. The observations are numbered from 1
- to however many observations you have, and you are being asked here to
- specify the size of the largest variable.
-
- Once you supply a number of observations, you are limited to
- variables of this size or smaller, in the normal operation of the
- program. However, the user can at a later point extend the size of the
- sample range using the Extend Sample Range command, listed under the
- Housekeeping Operations .
-
- Next you will be presented with the following menu of choices:
-
- 1. CATALOG DATA IN MEMORY
- 2. CATALOG FILES ON DISK
- 3. DISPLAY DATA
- 4. PRINT DATA
- 5. ENTER DATA
- 6. EDIT DATA
- 7. SAVE DATA TO DISK
- 8. RETRIEVE DATA FROM DISK
- 9. CHANGE SAMPLE RANGE
- 10. COMPUTE A NEW VARIABLE
- 11. MEANS, VARIANCES, AND CORRELATIONS
- 12. ORDINARY LEAST SQUARES REGRESSION
- 13. REGRESSION - AUTOCORRELATION
- 14. TWO STAGE LEAST SQUARES
- 15. OUT OF SAMPLE REGRESSION FIT
- 16. OUTLIERS AND INFLUENCE
- 17. SCATTER PLOT
- 18. TIME PLOT
- 19. LOAD DATA FROM AN ASCII FILE
- 20. HOUSEKEEPING OPERATIONS
- 21. RESTART PROGRAM
- 22. EXIT PROGRAM
-
-
-
-
-
-
-
- PAGE 5
- ECSTAT(tm) Econometrics Program
-
-
-
- If you are using the program for the first time, or if you are
- starting a new problem, then you will want to enter data, so enter a 5
- and then hit the Enter key (carriage return). Data may be entered for
- one or more variables at a time. You first supply a name for each of
- the variables you are entering data for.
-
- ONLY LETTERS AND NUMBERS MAY BE USED FOR VARIABLE NAMES, AND THE
- FIRST CHARACTER OF THE NAME MUST BE A LETTER.
-
- Also, you should NOT use any of the following names, each of
- which has a special meaning for the program:
-
- CONST RESID SRESID LOG EXP SQR ABS SIN COS TAN
-
- You will next be prompted to enter the data for each variable in
- turn, one observation at a time. Decimal points are fine in numbers,
- but DO NOT USE ANY COMMAS. (Numbers may also be entered using
- scientific notation. Enter the mantissa, an E, and a two digit
- exponent. E.G. 1.23E02 = 123.) If you just hit the enter key, the
- program will supply a zero and skip to the next observation (or if you
- have backed up to the current observation, hitting return will maintain
- the previous value and advance to the next variable.)
-
- Aside from entering numbers, there are two special commands that
- you can use during data entry. These are:
-
- B (Backup) - move back one variable and re-enter data. If used
- repeatedly, this will allow you to space back and correct a
- mis-entry.
-
- E (End) - stop data entry. The program will supply zeroes for
- the remaining observations on the variables.
-
-
- Displaying Data
-
- Once you have entered data, you will often want to see what you
- have entered. Data can be displayed on the screen (using option #3 on
- the Main menu), or the data can be printed out on the printer (option
- #4). In each case, the program will ask you for the names of the
- variables to be displayed. These can be the names of variables that
- you have entered data for, or variables that you have created, using
- the procedure described in a later paragraph. You can enter as many
- names as you want, but the computer will display the data four
- variables at a time, doing the first four, and then the second four,
- etc. (if you forget what the names of the variables are, you can find
- out the names from option #1, Catalog data, described below.)
-
- If you have chosen to print the data out, make sure that a printer
- is connected to the computer, that it is turned on, and that it has
- paper.
-
-
-
-
-
-
-
-
-
-
- PAGE 6
- ECSTAT(tm) Econometrics Program
-
-
- Editing Data
-
- If you need to change the values of observations in a variable
- (because you have revised data, or because you made a mistake in
- entering the data), you can do so with Option #6, Edit Data. Editing
- is done one variable at a time. The program will then ask:
-
- OBSERVATION NUMBER TO BE CHANGED >
-
- Here you can do one of three things. You can:
-
- 1. Supply an observation number (its place in line, NOT its value.)
- The program will then allow you to change the value of that
- observation.
-
- 2. Enter an N (for Next), and the program will move to the next
- observation.
-
- 3. Hit the Return key only, and the program will take you back to
- the Main Menu.
-
- If you have supplied an observation number (or the next observation)
- the program will print the current value of that observation and ask:
-
- NEW VALUE?>
-
- Here you can do several things:
-
- 1. If you enter a new number, the program will print the old and
- the new values of that observation and then ask for the next
- observation.
-
- 2. If you simply hit the return key, the program will leave the
- observation unchanged, and ask you for the next observation you
- want to change.
-
- 3. If you enter D (for Drop), the program will delete the current
- value of this observation, and move all succeeding values back
- one place in line. The last observation of the variable becomes
- zero. This is useful if you copy something twice.
-
- 4. If you enter I (for Insert), the program will move all the
- values one place forward in line, starting with the current
- observation. This will open up a hole at the current
- observation, and the program will then ask you for a value to
- put in there. This is useful if you leave something out in
- copying a series of numbers. (Remember that the process of
- moving numbers ahead will cause the original value of the last
- observation of the variable to be dropped.)
-
- After each of these observations, the program will ask you for the
- number of the next observation to work with. To get back to the main
- menu, just hit the Return key alone.
-
-
-
-
-
-
-
-
-
- PAGE 7
- ECSTAT(tm) Econometrics Program
-
-
- Cataloging the Variables
-
- To find the names of all the variables that the computer is
- currently storing, do Option 1 at the Main Menu. The computer will
- then tell you the number of observations that are stored for each
- variable (this is the same for all variables), the number of variables
- that you have defined, and the number of remaining variables that the
- computer can hold. Then it will tell you the names of the variables
- that it is storing.
-
- The first name on this list will always be CONST . CONST is a
- variable that the computer defines for you, and is equal to 1 in each
- of its observations. You cannot alter this variable, and you should
- not try to define another variable with the same name. This variable
- is included to employ a constant term in a regression.
-
- The catalog will also tell you the current sample range, which is
- described in the section "About Variables" below.
-
-
- Storing and Retrieving Data from Disks
-
- Data can be stored on disks, and later retrieved from them, so you
- don't have to re-enter data each time you use the program.
-
- When you use this program, put your program disk in drive A: . You
- can store files on this disk (there should be plenty of room), or for
- extra space you can store files on a second disk in drive B: . When
- storing or retrieving files from a drive other than the default drive,
- make sure you include the device prefix. E.g. B:SAMPLE.DAT .
-
-
- Storing files
-
- If you choose Option 7, "Save Data to Disk", the computer will ask
- you for a filename. Give the computer the file name and press Return,
- and it will store the file for you.
-
- Retrieving Files
-
- If you choose Option 8, "Retrieve Data from Disk", the computer
- will go to the appropriate drive and look for the file. If it is
- there, and if the file was created by this program, it will read the
- data into its memory and record the variable names. If the file is not
- there, the program will tell you.
-
- If you don't happen to remember the name of the file that you want,
- you can have the program give you the names of the files stored on the
- disk in either drive, by replying with a question mark "?" to the name
- of file question (don't type the quotation marks.) The program will then
- ask you for the appropriate drive.
-
- It is possible to combine data from two or more saved files.
- Retrieve one file using Option 8. Then use the add data procedure under
- Option #20 (Housekeeping Operations), which is described below.
-
-
-
-
-
-
-
- PAGE 8
- ECSTAT(tm) Econometrics Program
-
-
- Displaying the Names of Files Stored on Disks
-
- If you want to find out the names of all the files that you have
- stored on a disk, you can do so using Option #2 of the Main menu,
- "Catalog Files Stored on Disk". The program will ask you:
-
- WHICH DRIVE?>
-
- to which you should respond A or B (use capital letters, as
- always.) The program will then print out the names of the files stored
- on the disk in that drive. (The program will accept drive designations
- A through H.)
-
- About Variables
-
- The remaining sections require you to know something about the way
- the program stores and manipulates variables. Once a variable is
- created and given a name, that name refers to the variable as a whole,
- in other words, the whole column of numbers (observations) that make up
- the variable. When you work with variables, as in regressions, finding
- means, or doing plots, the program will work with all the observations
- of that variable. If you add two variables together to form a third,
- or multiply two variables together to form a third (described below),
- the computer will add (or multiply) the two variables observation by
- observation to form the observations of the third.
-
- Sample Range
-
- There is a way to restrict the observations that the program works
- with when it does regressions, finds means, does plots, or computes new
- variables. This is known as setting the "sample range". When you
- first create variables, you are asked the number of observations, and
- this sets the maximum range for all variables. This maximum remains
- constant as long as you use a particular data set, and is stored along
- with the variables when you store data on a disk. When you first start
- the program, or when you retrieve data from a disk, the sample range is
- set equal to this maximum range. However, you can change the sample
- range to use only a portion of the total number of observations, and
- you can also choose the sample range so that certain observations
- within the variable are dropped.
-
- This is done by choosing Option #9 "Change Sample Range", on the
- Main Menu. To make the examples clearer, suppose that each variable
- has 20 observations in all; the maximum range is 1 to 20, and the
- sample range is initially set equal to this.
-
- Suppose you want to use only observations 1 to 15. You choose
- Option #9, and the program will ask you:
-
- ENTER SAMPLE RANGE(S):
-
- You respond by typing in 1, a space, 15, and then Enter, so the screen
- looks like this:
-
- ENTER SAMPLE RANGE(S): 1 15
-
-
-
-
-
-
-
- PAGE 9
- ECSTAT(tm) Econometrics Program
-
-
-
- The program will return you to the main menu, and all regressions,
- means, plots, and computed new variables will use only observations 1
- to 15 of any variable. To change the sample range, you have to use
- Option #9 again. To find out what the current sample range is, use
- Option #1 "Catalog Data in Memory".
-
- Other options for specifying the sample range include:
-
- ENTER SAMPLE RANGE(S): 2 10 13 20
-
- this forces the program to use only observations 2 to 10 and 13 to 20,
- dropping observations 1, 11, and 12. The numbers that you supply the
- program must be in ascending order, must fall within the maximum range
- of the observations (1 to 20 in this example), and up to ten pairs may
- be used.
-
- You can also select individual observations like so:
-
- ENTER SAMPLE RANGE(S): 8 8 10 20
-
- which forces the computer to use observation 8 and observations 10 to
- 20. Note that the 8 must be entered twice here (always maintain
- pairs.) The following ranges are invalid:
-
- 1 25 takes sample range beyond maximum number of
- observations (20 in this example.)
-
- 8 3 sample must be given in ascending order
-
- 1 18 20 not an even number of entries.
-
- 1 8 8 20 a single observation number cannot end one pair and
- start another.
-
-
- Lags and Leads
-
- Suppose you were running a regression model and wanted to regress
- the current level of investment (I) on last year's level of GNP. The
- program allows you to pair one observation of I with the previous
- observation of GDP by specifying GNP in the regression as GNP[-1] .
-
- The figure in square brackets is the lag. It says that observation
- number 5 of GNP[-1] is really observation number 4 of GNP. You
- can lag a variable for as many periods as you wish (subject to the
- warning below); thus if you have monthly data on car sales, CARS ,
- then CARS[-12] would be the sales of the corresponding month of the
- previous year.
-
- The number in square brackets can also be positive, thus GNP[1] and
- GNP[+1] (it doesn't matter which you use) refer to GNP in the next
- period.
-
-
-
-
-
-
-
-
-
- PAGE 10
- ECSTAT(tm) Econometrics Program
-
-
- Restrictions on using lags are:
-
- 1. The sample range must be adjusted so that the lag or lead does
- not take the variable outside the range of available data. In
- our previous example, if you had 20 observations and were using
- GNP[-1] then you would set the sample range at 2 20 .
-
- 2. Lagged variables can generally be used anywhere on the right
- hand side of an equation, but not the left hand side. Thus you
- can regress an unlagged variable on a lagged variable, but you
- can't use a lagged variable as your dependent (LHS) variable.
-
- Similarly, you can create an unlagged variable as a function
- of lagged variables, but you must use an unlagged name in
- creating a new variable.
-
- Lagged variables can be used in scatter plots and time plots,
- and can be included when you calculate means, variances and
- covariances.
-
- 3. Don't use variables with zero lag, and avoid embedded spaces in
- lags. Thus DON'T use GNP[0] use GNP
- DON'T use GNP[ -1] use GNP[-1]
- Make sure no space comes between the variable name and the open
- brackets, ie don't use GNP [-1].
-
-
- Computing New Variables
-
- The program will do the tedious work of taking logarithms of
- variables, or adding two variables together to form a third. Use
- Option #10, "Compute a New Variable" to form new variables (with new
- names). When you choose option 10, the program will ask you:
-
- ENTER FORMULA FOR VARIABLE TO BE COMPUTED
-
- >
-
- You then give the program a name for the new variable that you are
- creating, and an equation that defines it. For example you might
- define consumption (CONS) as the difference between GNP and
- investment:
-
- > CONS = GNP - I
-
- The program will compute CONS by subtracting I from GNP observation
- by observation.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- PAGE 11
- ECSTAT(tm) Econometrics Program
-
-
- The functions that are available to you are:
-
- + addition
-
- - subtraction
-
- * multiplication (an asterix) (DONT use X)
-
- / division
-
- ^ exponentiation (ie W^5 is W to the fifth power)
-
- LOG() take the natural logarithm of what is in parentheses
-
- EXP() raise e to the power of what is in parentheses
-
- SQR() take the square root of what is in parentheses
-
- ABS() absolute value
-
- SIN() , COS() , TAN() sine, cosine, tangent
-
-
- You can form fairly complicated formulas by combining the
- operations above, and by using parentheses. However there are a few
- things you must be careful of. When several operations are included in
- a formula, the program does them in a particular order. The order is:
-
- 1. The functions LOG EXP SQR ABS SIN COS TAN are calculated first
-
- 2. exponentiation is done second.
-
- 3. multiplication and divison are done third.
-
- 4. addition and subtraction are done last.
-
- Thus:
-
- 5+3*2 = 11 (not 16)
-
- 2^2*3 = 12 (not 64)
-
- if you are in doubt about the order of calculation, use parentheses:
-
- (5+3)*2 = 16
-
- 2^(2*3) = 64
-
- For the most part you will be working with variables that already
- exist. Some examples:
-
- LGNP = LOG(GNP) calculates the log of GNP
-
- PCGNP = 100*(GNP/GNP[-1] - 1) calculates the percentage change
- in GNP.
-
-
-
-
-
-
-
- PAGE 12
- ECSTAT(tm) Econometrics Program
-
-
-
- Some things to remember:
-
- 1. In calculating the new variable, the program needs to be able to
- write on the program disk. DO NOT WRITE-PROTECT YOUR PROGRAM
- DISK!
-
- 2. Don't try to take the square root of a negative number, the
- logarithm of zero or of a negative number, and don't divide
- by zero.
-
- 3. When squaring a variable W, use W*W and not W^2 . The first
- method is faster, and more accurate.
-
- 4. The program will tell you if it has successfully calculated your
- formula, but it won't tell you if that was really what you
- wanted to calculate. Be careful, and display and check your
- data occasionally.
-
-
- Calculating Means, Variances, and Correlations
-
- Option #11 allows you to calculate the means, standard deviations,
- and variances of a group of variables, and the correlations among them.
- If you choose option 11 the program will ask:
-
- ENTER VARIABLE NAME(S) SEPARATED BY A SPACE>
-
- Up to 20 variable names may be entered. The program will use only the
- observations specified in the current sample range, and will calculate
- means, variances and standard deviations, as well as correlation
- coefficients for the variables. You will be given an opportunity to
- print the results if you wish to. Make sure the printer is on and has
- paper if you do want to print out results. It is perfectly all right to
- include lagged variables in the list of names, but make sure that the
- sample range is adjusted so that you do not go outside the available
- data.
-
-
- Multiple Regression
-
- Option #12 allows you to run an ordinary least squares regression
- of one dependent variable on up to 20 right hand side variables
- (including the constant.) The regression will be calculated using the
- current sample range. When you choose option 12, the program will ask
- for the name of the dependent (left hand side) variable, and then will
- ask for the independent (right hand side) variables.
-
- CONST There is a variable that is internal to the program, called
- CONST that consists entirely of 1's. You must include this
- variable in your list of right hand side variables in order to
- get a constant term in the regression.
-
-
-
-
-
-
-
-
-
-
- PAGE 13
- ECSTAT(tm) Econometrics Program
-
-
- For example, if you wanted to regress the level of consumption
- expenditures (CONS) on a constant, its own lagged value, the level of
- GNP and the interest rate (R), you would respond so the screen looks
- like this:
-
- ENTER DEPENDENT VARIABLE
- VARIABLE NAME IS?> CONS
-
- ENTER INDEPENDENT VARIABLES
- ENTER VARIABLE NAMES SEPARATED BY A SPACE> CONST CONS[-1] GNP R
-
- The program will then calculate the regression for you, and print on
- the screen the estimated coefficients, along with their estimated
- standard errors and T-statistics. The program will also display
- several summary statistics concerning the regression, and give you the
- option of showing the estimated variance-covariance matrix of the
- estimated coefficients.
-
- You will also be given the option to repeat the output on the
- screen, and to print either the coefficient estimates, the variance
- covariance matrix, or both.
-
- RESID The program contains an internal variable called RESID
- which contains the residuals from the last regression that
- was performed. You can save these residuals by moving them to
- another variable, through the computation procedure in Option
- #10. Thus you might use option 10 and respond:
-
- > RES = RESID
-
- The fitted value of the variable may be found by subtracting
- RESID (or RES in this example) from the actual value of the
- dependent variable (CONS in this example.)
-
- > FIT = CONS - RESID
-
- These new variables, RES and FIT could be examined later,
- or plotted on the screen.
-
-
- Correction for First-Order Autocorrelation (Cochrane-Orcutt)
-
- The program allows regression estimates corrected for first order
- autocorrelation using the Cochrane-Orcutt method. The method involves
- using quasi-differences of the variable data (eg CONS - RHO*CONS(-1)).
- The procedure works the same way as in ordinary least squares; you are
- asked for the dependent variable, and then for a list of independent
- variables. In addition, you will be asked if you want to choose a
- starting value for the autocorrelation coefficient, RHO . If you reply
- NO , or simply use a carriage return, the program will start with an
- initial value of zero.
-
-
-
-
-
-
-
-
-
-
-
- PAGE 14
- ECSTAT(tm) Econometrics Program
-
-
- The procedure iterates to get a progressively better value for RHO,
- and proceeds until the successive changes in RHO are small. The
- procedure is slow, so wait for it. It will tell you if anything is
- wrong. The program will print the final value of RHO , the estimated
- coefficients, and their estimated standard errors and T-statistics, and
- give you the option of seeing the variance-covariance matrix. You can
- repeat the screen output, or have it printed out.
-
- The program also makes available the residuals from the estimation
- procedure, and these are available in the variable RESID .
-
- WARNING: In the current version of the program, the sample range for
- the estimation must be continuous.
-
-
- Two Stage Least Squares
-
- Option #14 allows you to estimate an equation using instrumental
- variables (two-stage least squares). If you choose option 14 the
- program will first ask you for the dependent variable, then the
- explanatory variables, just as in ordinary least squares. Finally the
- program will ask you for the names of the variables that you wish to
- include as instruments. Here you should include the names of all of the
- variables you specified as explanatory variables that are exogenous
- (including the constant) and at least one instrumental variable for each
- endogenous variable included in the list of explanatory variables. Thus
- there must be at least as many instruments in total as there are
- explanatory variables in the equation.
-
- For example, suppose that you are estimating consumption (CONSUMP)
- as a function of income (Y) and the interest rate (R). You consider
- income and consumption to be endogenous, while you assume that the
- interest rate is exogenous (given by world interest rates.) You also
- consider exports (X) and government expenditure (G) to be exogenous
- variables, and so available for use as instruments. To estimate a
- comsumption function using two stage least squares you would respond:
-
- DEPENDENT VARIABLE
- VARIABLE NAME IS? > CONSUMP
-
- EXPLANATORY VARIABLES
- ENTER VARIABLE NAMES
- SEPARATED BY A SPACE > CONST Y R
-
- INSTRUMENTS
- ENTER VARIABLE NAMES
- SEPARATED BY A SPACE > CONST R X G
-
- The program will then perform the two-stage regression, print out
- estimated coefficients and standard errors, and the estimated variance-
- covariance matrix. Residuals are made availble in the variable RESID,
- and the equation can be estimated out of sample using the following
- procedure.
-
-
-
-
-
-
-
-
-
- PAGE 15
- ECSTAT(tm) Econometrics Program
-
-
- Forecasting a Regression Equation Beyond the Sample
-
- Option #15 allows you to project an equation estimated by any of
- the regression options outside the sample upon which the equation was
- originally estimated. Suppose, for example, that you had estimated the
- consumption equation described above, using observations 1 to 15
- (sample range 1 15). The forecast option allows you to see how well
- the equation does at predicting the values of consumption in periods 16
- or later, using the right hand side variables for those periods, and
- the estimated regression model from the earlier observations.
-
- First, you must run the regression on the sample range of 1 to 15.
- Immediately after you run the regression, choose option 15 from the
- main menu. The program will ask you for the sample range for the
- forecast, and if you wanted to use the remaining observations, you
- would respond 16 20 . However the program also allows you to include
- observations within the original estimation period, so you can see how
- the equation was doing at the point at which it started forecasting.
- In this case, you might reply 12 20 , to see the last four
- observations in the estimation period, and the five observations of the
- forecast period.
-
- The program will display actual values of the left hand side
- variable, the fitted value from the regression equation, and the
- prediction error for each observation. Some summary statistics are
- calculated for the forecast period and displayed. (These only apply to
- the observations outside the original estimation period.) The program
- will also ask you if you want to see a graph of the results. If you
- respond Y (yes), then the program will prepare a time plot of the
- actual and fitted values, and separate the estimation from the forecast
- period by a dashed vertical line.
-
- If you exit this option here, the sample range will remain that of
- the forecast, and this sample range will apply to all operations you do
- after the forecast. The program will automatically tell you the
- current sample range, and will ask you if you want to change the sample
- range. Either enter the desired sample range, or hit Return to
- retain the current range.
-
-
- (A technical note: If the original equation was estimated using a
- correction for serial correlation of the error term, the out of sample
- forecast will add in a fraction of the error term of the last
- observation of the estimation period. That fraction is RHO raised to
- the power of the current observation number minus the number of the
- last observation of the sample period. Forecast errors within the
- forecast period are NOT used to improve the next period forecast. For
- correct results, the forecast range must be continuous.)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- PAGE 16
- ECSTAT(tm) Econometrics Program
-
-
- Outliers and Influence
-
- As an aid to regression diagnostics, Option #16 will allow you to
- retrieve corrected (Studentized) residuals, and to determine the Cook's
- Distance for each data point, a mesure of the influence of that data
- point on the regression results. The studentized residuals are
- scaled to have unit variance, and are calculated by using the following
- matrix:
-
- M = (I - X(X'X) X')
-
- which produces the residuals from the error term in the regression
- model. Option #16 calculates the Studentized residuals from the last
- regression that was performed, prints them out, and also stores them in
- an internal variable SRESID , where they can be retrieved using option
- #10 and plotted. The program also prints out the (uncorrected)
- residual, the diagonal elements from the M matrix, Mii , and the
- Cook's Distance for the data point. The last is a measure of the extent
- to which the regression coefficients would have changed, had that
- particular data point been deleted from the sample.
-
- Although the Cook's Distance measure is not distributed as an F
- distribution, the F table does provide an approximate scale by which to
- judge the significance of the measure. For further information on
- Cook's Distance, and on the studentized residuals, see Weisberg,
- Sanford, Applied Linear Regression (New York; Wiley, 1980) Chapter 5.
-
- NOTE: The outliers and influence procedure is only available
- following an ordinary least squares regression.
-
-
- Graphics
-
- The program makes some rudimentary graphics available to you. The
- program will produce time plots of up to four variables (plots of the
- variables by observation), and will produce scatter plots of one
- variable against another.
-
- Note: On the IBM Personal Computer, the use of either of these
- options requires that you be using advanced basic, and that the results
- be displayed on a screen connected to the Color/Graphics Adapter.
-
-
- Scatter Plot
-
- Option #17 allows you to produce a scatter plot of values of one
- variable against the corresponding values of another variable. When
- you choose this option, you will be asked for the name of the variable
- to put on the X-axis and the variable to put on the Y-axis . The
- program will then draw the scatter plot. The axes are labelled, but
- the units are not marked. The axes will shift to indicate where zero
- is for each variable, if zero is included in the values within the
- sample range of either variable.
-
-
-
-
-
-
-
-
-
- PAGE 17
- ECSTAT(tm) Econometrics Program
-
-
- Time Plot
-
- Option #18 will plot up to four variables by observation, drawing
- lines between successive values of the variables. The actual values
- for each observation are indicated by, successively, a + , an X, a box,
- and a diamond. The units are not given on the axes, but the X-axis
- will shift to indicate where zero is, if it falls within the range of
- values of the variables.
-
- Before the program draws the time-plot, it will ask you whether you
- want the variables scaled by means. If you say no, the program will
- plot the actual value of the variables on the screen. If you say yes,
- the program will divide the values of each variable by the sample
- average of the variable. This puts the variables in the same range,
- and is useful if the variables differ greatly in size.
-
-
-
- Loading Data from Non-ECSTAT Files
-
- Option #19 allows the user to enter data from ASCII files. This
- allows transfer of data from spreadsheet programs such as VisiCalc
- (using xxxxxx.PRF files) or SuperCalc or 1-2-3 (using xxxxxx.PRN
- files). It also allows the user to prepare a data file using a
- word-processing or editing program.
-
- The program expects certain things of the ASCII file that it is
- reading in, and care should be taken to produce files that meet these
- requirements. One or more initial lines of the file may be blank, these
- will be ignored by the program. The first line of information in the
- file may optionally be a list of the variable names to which the data
- corresponds. Note that these names must all appear on a single line,
- separated by spaces.
-
- The rest of the file must consist only of data (numbers), separated
- by spaces. The data may either be given as values for each of the
- variables in turn for a single observation, followed by data for the
- variables for the next observation (ordering by observation). Or the
- data may be given as all the observations for a single variable,
- followed by all the observations for the next variable, etc. (ordering
- by variable). ALL THE VARIABLES MUST HAVE THE SAME NUMBER OF
- OBSERVATIONS OF DATA.
-
- Ordering the data by observation is preferable if it can be done.
- In a spreadsheet program this would correspond to a Print file with the
- data for each variable in columns. Thus a data file with odd numbers,
- even numbers, and powers of two would look like:
-
- ODDS EVENS TWOS
- 1 2 2
- 3 4 4
- 5 6 8
- 7 8 16
-
-
-
-
-
-
-
-
-
- PAGE 18
- ECSTAT(tm) Econometrics Program
-
-
- When you load a file using option 19, the program will first ask
- you for the name of the file that contains the data. Next it will ask
- for the number of observations (data points) for each variable, and the
- number of variables. It will next ask if variable names are included
- in the file. If variable names are not given in the file, you will be
- asked to supply them. Finally, you will be asked whether the data is
- ordered by observation or by variable.
-
- Loading data from an external file is by its nature much trickier
- than loading data from a file created by the program. After you load
- the data you should check the variables currently held in memory, and
- display the values for the first and the last variable loaded.
-
-
- Housekeeping Operations
-
- Choosing option #20 produces the following menu:
-
- 1 RENAME A VARIABLE
- 2 DELETE VARIABLE(S)
- 3 EXTEND DATA RANGE
- 4 ADD DATA FROM A DISK FILE
- 5 RETURN TO MAIN MENU
-
- Option #1 allows you to change the name of a variable currently
- being held in memory. The program will display a list of the current
- variable names, ask you for the old name, and then for the new name.
-
- Option #2 allows you to delete one or more variable to free up
- space. The program will display a list of the current variable names,
- and ask you for the names of one or more variables to be deleted.
-
- Option #3 allows you to increase the maximum range of variables to
- include new observations. You will be told the current maximum
- observation number, and asked to specify a new maximum. The program
- will supply zeroes for the added observations. Data values can be
- supplied using the Edit operation from the main menu.
-
- Option #4 allows you to read in data from a disk file, and add it to
- the data that is currently being stored in memory. In this way, data
- from two or more data files can be combined. The length of stored
- variables in memory is determined by the current maximum range. If the
- number of observations on the variables stored in the second disk file
- is greater than this range, the final observations on the added variable
- will be dropped when they are read in. If the current maximum data
- range is longer than the variables that are being read in from the
- second disk file, the remaining observations will be set to zero.
-
- In using Option #4, you must take particular care to assure that the
- observation numbers on the original data in memory and the observation
- numbers on the data being read in correspond. The program assumes that
- they match up correctly.
-
-
-
-
-
-
-
-
-
-
- PAGE 19
- ECSTAT(tm) Econometrics Program
-
-
- Remaining Options
-
- The remaining options are Option #21, which allows you to start
- the program over from the beginning, so as to use a new data set.
- Option #22 allows you to quit the program. You should be careful using
- either of these options, because you will lose the values of the
- current variables, unless you have saved them on the disk.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-